<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDriverOthersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('driver_others', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('company_id')->comment('所属公司');
            $table->decimal('balance',10,2)->default(0)->comment('代驾钱包');
            $table->bigInteger('driver_id')->nullable()->comment('司机ID');
            $table->enum('status', [1, 2, 3, 4, 5, -1])->default(-1)->comment('状态：1-待审核，2-在职，3-驳回，4-冻结，5-离职，-1-未申请');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `driver_others` comment '司机代驾表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('driver_others');
    }
}
